<template>
  <div class="project zy-content">
    <Tabs class="tabs-layout" v-model="tagName" :animated="false">
      <template v-for="item in tagList">
        <TabPane :key="item.name"
                 :label="item.labeL"
                 :name="item.name">
          <tableList ref="tableList" :ifFinish.sync="item.ifFinish" :tagName.sync="tagName"/>
        </TabPane>
      </template>
    </Tabs>
  </div>
</template>

<script>
import tableList from "./Components/tableList";
export default {
  name: "index",
  components:{tableList},
  data(){
    return {
      tagName:this.$t('fault.Unfinished'),
      tagList:[
        {labeL:this.$t('fault.Unfinished'),name:'未完成',ifFinish:0},
        {labeL:this.$t('fault.Complet'),name:'已完成',ifFinish:1}
        ]
    }
  },
  watch:{
    tagName:function (){
      const obj = this.tagList.find(item=> item.name===this.tagName)
      this.$refs.tableList[this.tagList.indexOf(obj)].searchList()
    }
  }
}
</script>

<style scoped lang="scss">
/deep/ .ivu-tabs-tab {
  font-size: 18px;
}
</style>
